package my.package0407;

import java.util.Scanner;

public class dome5 {
    public static void main(String[] args) {
        int[] grade = new int[6];
        for (int i = 0; i < grade.length; i++) {
            Scanner SC = new Scanner(System.in);
            System.out.println("Please enter" + (i + 1) + "judge's score is:");
            grade[i] = SC.nextInt();
            if (grade[i] < 0 || grade[i] > 100) {
                System.out.println("Input error!Please enter again!");
                i--;
            }
        }
        int temp;
        for (int i = 0; i < grade.length - 1; i++) {
            for (int j = 0; j < grade.length - 1 - i; j++) {
                if (grade[j] > grade[j + 1]) {
                    temp = grade[j];
                    grade[j] = grade[j + 1];
                    grade[j + 1] = temp;
                }
            }
        }
        int score = (grade[1] + grade[2] + grade[3] + grade[4]) / 4;
        System.out.println("The score is"+ score);
    }
}
